﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Commons.Entity;

namespace MvcMasterPage.Controllers
{
  public class BaseController : Commons.Web.BaseController
  {
    #region Properties
    /// <summary>
    /// 母板页
    /// </summary>
    protected override string MasterFile
    {
      get
      {
        if (this.HttpContext.Session["UserID"] != null
          && Convert.ToInt32(this.HttpContext.Session["UserID"]) > 0)
          return "~/views/shared/_UserLayout.cshtml";
        else
          return "~/views/shared/_Layout.cshtml";
      }
    }
    /// <summary>
    /// 当前用户凭证
    /// </summary>
    protected int UserID
    {
      get
      {
        return Session["UserID"] == null ? 0 : Convert.ToInt32(Session["UserID"]);
      }
    }
    #endregion
  }
}